<%@ page language="java" import="java.util.*"
	contentType="text/html;charset=gb2312" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 	<head>
  	<script type="text/javascript">
		function checkValidate() { 
			if (forms.schoolid.value == "" || forms.schoolid.value == null) {
				window.alert("学号不能为空！！！");
				return false;
			}
			if (forms.name.value == "" || forms.name.value == null) {
				window.alert("姓名不能为空！！！");
				return false;
			} 
			if (forms.idnumber.value.length!=18) {
				window.alert("身份证号错误！！！");
				return false;
			}
			if (forms.email.value == "" || forms.email.value == null) {
				window.alert("邮箱不能为空！！！");
				return false;
			}
			if (forms.password.value == "" || forms.password.value == null) {
				window.alert("密码不能为空！！！");
				return false;
			}
			if (forms.image.value == "" || forms.image.value == null) {
				window.alert("验证码不能为空！！！");
				return false;
			}
			if (forms.password_confirm.value == "" || forms.password_confirm.value == null) {
				window.alert("密码确认不能为空！！！");
				return false;
			}
			if (forms.password_confirm.value != forms.password.value) {
				window.alert("密码确认错误！！！");
				return false;
			} else
			return true;
		}
	</script>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet"
		href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">	
	<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
	<script
		src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
    <base href="<%=basePath%>">
    
    <title>学生注册</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  		<form id="forms" name="forms" action="sRegist.action" method="POST">
		<h1 align="center">学生注册  </h1>
		<br />
		<center>
			<table border=1>
				<tr>
					<td>用户名（学号）：</td>
					<td><input type="text" name="schoolid" size="20"
						maxlength="13" /></td>
				</tr>
				<tr>
					<td>姓&nbsp;&nbsp;名：</td>
					<td><input type="text" name="name" size="20"
						maxlength="20" /></td>
				</tr>
				<tr>
					<td>身份证号：</td>
					<td><input type="text" name="idnumber" size="20"
						maxlength="18" /></td>
				</tr>
				<tr>
					<td>邮&nbsp;&nbsp;箱：</td>
					<td><input type="text" name="email" size="20"
						maxlength="50" /></td>
				</tr>
				<tr>
					<td>密&nbsp;&nbsp;码：</td>
					<td><input type="password" name="password" size="20"
						maxlength="16" /></td>
				</tr>
				<tr>
					<td>确认密码</td>
					<td><input type="password" name="password_confirm" size="20"
						maxlength="16" /></td>
				</tr>
				<tr>
					<td><input type="submit" name="submit" value="注册"
						onclick="return checkValidate();" data-role="button" /></td>
					<td><input type="reset" name="Reset" value="重置"
						data-role="button" />
				</tr>
			</table>
			<table><tr><td>
			<input name="image" type="text" id="image" title="验证码区分大小写" size="15"
				maxlength="4" /> <img src="image.jsp" alt="验证码" id="authCode"
				onclick="this.src='image.jsp?random='+Math.random()"> <a
				href="#" onclick="myReload()">看不清，换一张</a>
			</td></tr>
			</table>
		</center>
	</form>
	<script type="text/javascript">
		//用于刷新验证码  
		function myReload() {
			document.getElementById("authCode").src = document
					.getElementById("authCode").src
					+ "?random=" + new Date().getTime();
		}
	</script>
	<center><table><tr><td>
	<a href="index.jsp"
		onclick="this.src='image.jsp?random='+Math.random()" id="button-3"
		data-role="button">返回</a>
	</td></tr></table></center>
</html>
